<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Edge Server Management</title>
    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css">
    <link rel="stylesheet" href="{{ url_for('static', filename='base.css') }}">
    {% block head %}{% endblock %}
    <style>
        body {
            font-family: Arial, sans-serif;
             background: url('{{ url_for('static', filename='a.jpg') }}') no-repeat center center fixed;
            background-size: cover;
            background-size: cover;
            color: #343a40;
        }
        header {
            background: rgba(0, 0, 0, 0.7);
            color: #fff;
            padding: 1rem 0;
        }
        header h1 {
            text-align: center;
            margin: 0;
            font-size: 2.5rem;
        }
        nav {
            margin-top: 1rem;
        }
        nav ul {
            display: flex;
            justify-content: center;
            list-style: none;
            padding: 0;
        }
        nav li {
            margin: 0 1rem;
        }
        nav a {
            color: #fff;
            text-decoration: none;
            font-size: 1.2rem;
            transition: color 0.3s;
        }
        nav a:hover {
            color: #ffc107;
        }
        main {
            margin-top: 2rem;
            background: rgba(255, 255, 255, 0.8);
            padding: 2rem;
            border-radius: 10px;
        }
        .flashes {
            list-style: none;
            padding: 0;
        }
        .flashes li {
            background-color: #ffc107;
            color: #343a40;
            padding: 0.5rem;
            margin-bottom: 1rem;
            border-radius: 5px;
        }
    </style>
</head>
<body>
    <header>
        <h1>Edge Server Management</h1>
        <nav>
            <ul>
                <li><a href="{{ url_for('home') }}">Home</a></li>
                {% if current_user.is_authenticated %}
                    <li><a href="{{ url_for('connect') }}">Connect</a></li>
                    <li><a href="{{ url_for('nodes') }}">Nodes</a></li>
                    <li><a href="{{ url_for('data') }}">Data</a></li>
                    <li><a href="{{ url_for('logout') }}">Logout</a></li>
                {% else %}
                    <li><a href="{{ url_for('login') }}">Login</a></li>
                    <li><a href="{{ url_for('register') }}">Register</a></li>
                {% endif %}
            </ul>
        </nav>
    </header>
    <main class="container">
        {% with messages = get_flashed_messages() %}
          {% if messages %}
            <ul class="flashes">
            {% for message in messages %}
              <li>{{ message }}</li>
            {% endfor %}
            </ul>
          {% endif %}
        {% endwith %}
        {% block content %}{% endblock %}
    </main>
    <script src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
    <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.bundle.min.js"></script>
</body>
</html>
